package cn.zhf.shop.controller;

import cn.zhf.shop.entity.Message;
import cn.zhf.shop.service.AuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/Audit")
@Api(tags = "清算对账模块")
public class AuditController {

    @Resource
    private AuditService auditService;

    @ApiOperation(value = "根据id查看清算对账")
    @GetMapping("/id")
    public Message selectById(int id){
        return auditService.selectByPrimaryKey(id);
    }


    @ApiOperation(value = "查询所有清算对账")
    @GetMapping("/all")
    public Message selectAll(){
        return auditService.selectAll();
    }

    @ApiOperation(value = "根据清算对账头部id获取")
    @GetMapping("/selectAllById")
    public Message selectAllById(String id) {
        return auditService.selectAllByAuditAuditTitleId(id);
    }

    @ApiOperation(value = "根据订单id获取")
    @GetMapping("/selectByMerorderno")
    public Message selectByMerorderno(String id) {
        return auditService.selectByMerorderno(id);
    }

}
